Skip to content

test(pm-stack): isolate health-priming server from machine state (#14167) - #14414

Merged
dezren39 merged 1 commit into
mainfrom
oc-code-03/14167-health-priming-isolation
Nov 24, 2026
Merged

dezren39 merged 1 commit into
mainfrom
oc-code-03/14167-health-priming-isolation

Conversation

@dezren39

@dezren39 dezren39 commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

Summary

Fixes #14167. The health-priming test spawned the real aggregator with the caller env and cwd in the package dir. Its writes and background jobs went to the machine:

  • quota-current.json, the quota heartbeat and the meta-renewal state defaulted to the package dir. The gatherer also reads QUOTA_CURRENT_PATH.
  • The freshness IPC port (4871) collided with a live aggregator.

Changes, all in pm-stack/aggregator/test/health-priming.test.ts:

  • Run the server from the tmp dir by absolute path.
  • Redirect PM_AGG_QUOTA_CURRENT_FILE, QUOTA_CURRENT_PATH, META_RENEWAL_STATE_PATH and PM_AGG_FRESHNESS_PORT into the tmp dir.
  • Add a guard test that fails if the run leaves files in the package dir.

Evidence

  • bun test test/health-priming.test.ts: 2 pass, 0 fail.
  • Before the fix the guard found meta-renewal.json and meta-credential.json in the package dir.
  • After the fix git status is clean in pm-stack/aggregator/.

Filed and worked from queue task 23336 (oc-code-03).

{
  "direct_parent": null,
  "links": [],
  "lineage": {
    "design": null,
    "roadmap_item": null,
    "priority": null
  },
  "pm_meta": 1,
  "provenance": {
    "queue_id": null,
    "scheduled_start": null,
    "picked_up_at": null,
    "work_started_at": null,
    "created_at": "2026-11-24T14:21:04Z",
    "session_id": "ses_e5df21b813effeAIn8E93bQWHV",
    "lane": null,
    "host": "amd",
    "worktree": "/home/user/git/code/.agent-worktrees/oc-code-03-14167",
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": {
      "kind": "worktree",
      "id": "/home/user/git/code/.agent-worktrees/oc-code-03-14167",
      "repo": "developing-today/code",
      "branch": "oc-code-03/14167-health-priming-isolation",
      "sha": "44bad6f965ce75dfbcae4f33de4532d33c63e111"
    },
    "auth_subject": "any-n",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

)

The health-priming test spawned the real aggregator with the caller env and
its cwd in the package directory. Quota-current, the quota heartbeat, the
meta-renewal state and the gatherer (QUOTA_CURRENT_PATH) all defaulted into
the package dir, the freshness IPC port collided with a live aggregator on
4871, and background quota gather ran against the real machine.

Point every writable path at the test tmp dir, run the server from there,
and add a guard that fails if the run leaves files in the package dir.
@coderabbitai

coderabbitai Bot commented Nov 24, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 29 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a2560927-cb45-4997-b6f7-1b099ba9331c
Commits

Reviewing files that changed from the base of the PR and between 091a9c4 and 44bad6f.

Files selected for processing: 1

  • pm-stack/aggregator/test/health-priming.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@dezren39
dezren39 merged commit 44bad6f into main Nov 24, 2026
2 checks passed
@dezren39
dezren39 deleted the oc-code-03/14167-health-priming-isolation branch November 24, 2026 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pm-aggregator tests: a run leaves three files of machine state in the package directory, and runs the real quota gather

1 participant